package com.kun.portal.webframe.po;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by Administrator on 2018-07-17.
 * 证书文件
 */
@Entity
@Table(
        name = "certificate_file"
)
@DynamicUpdate
public class CertificateFilePo {
    @Id
    @GeneratedValue(
            generator = "certificate_file_id"
    )

    @GenericGenerator(
            name = "certificate_file_id",
            strategy = "uuid"
    )
    @Column(
            name = "certificate_file_id",
            length = 32,
            nullable = false
    )
    private String certificateFileId;//id
    @Column(
            name = "file_name",
            length = 100
    )
    private String fileName;//文件名
    @Column(
            name = "file_url",
            length = 100
    )
    private String fileUrl;//文件地址
    @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.EAGER)
    @JoinColumn(name = "certificate_mgr_id", referencedColumnName = "certificate_mgr_id",insertable = true,updatable = true)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private CertificateMgrPo certificateMgrPo;

    public CertificateMgrPo getCertificateMgrPo() {
        return certificateMgrPo;
    }

    public void setCertificateMgrPo(CertificateMgrPo certificateMgrPo) {
        this.certificateMgrPo = certificateMgrPo;
    }

    public String getCertificateFileId() {
        return certificateFileId;
    }

    public void setCertificateFileId(String certificateFileId) {
        this.certificateFileId = certificateFileId;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }
}
